

logFile = None


def logStart():
    global logFile
    print("打印日志开始")
    logFile = open("log.txt", "w", encoding="utf-8")


def logPrint(str, bPrintlog=True):
    if (bPrintlog):
        global logFile
        logFile.write(str + "\n")
    print(str)


def logEnd():
    global logFile
    print("打印日志结束")
    logFile.close()
